package com.zzzy.sys.dao.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import java.time.LocalDateTime;

/**
 * <p>
 * 用户信息表
 * </p>
 *
 * @author fc
 * @since 2024-04-19
 */
@Getter
@Setter
@TableName("sys_user")
@Schema(name = "User", description = "用户信息表")
public class User {

    @Schema(description = "用户ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @Schema(description = "登录名")
    @TableField("user_name")
    private String username;

    @Schema(description = "真实姓名")
    @TableField("nick_name")
    private String nickName;

    @Schema(description = "密码")
    @TableField("`password`")
    private String password;

    @Schema(description = "手机号码")
    @TableField("phone_number")
    private String phoneNumber;

    @Schema(description = "用户邮箱")
    @TableField("email")
    private String email;

    @Schema(description = "部门ID")
    @TableField("dept_id")
    private Long deptId;

    @Schema(description = "部门名称")
    @TableField(exist = false)
    private String deptName;

    @Schema(description = "角色名称")
    @TableField(exist = false)
    private String roles;

    @Schema(description = "职务")
    @TableField("duty")
    private String duty;

    @Schema(description = "性别")
    @TableField("sex")
    private String sex;

    @Schema(description = "状态：新建、启用、暂停、离职")
    @TableField("`status`")
    private String status;

    @Schema(description = "创建时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("create_time")
    private LocalDateTime createTime;

    @Schema(description = "更新时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("update_time")
    private LocalDateTime updateTime;

    @Schema(description = "备注")
    @TableField("memo")
    private String memo;
}
